Ut.dialog = {
    tip: function (msg, callback) {
        swal({title: '', text: msg, allowOutsideClick: false}, callback);
    },
    warn: function (msg, btnname, callback) {
        swal({
            title: '',
            text: msg,
            type: 'warning',
            confirmButtonColor: '#DD6B55',
            confirmButtonText: btnname,
            closeOnConfirm: true
        }, callback);
    },
    errMsg: function (msg) {
        swal({title: I18N.ERROR, text: msg, type: "error", confirmButtonText: I18N.OK});
    },
    confirm: function (msg, callback) {
        swal({
            title: I18N.CONFIRM,
            text: msg,
            type: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#DD6B55',
            cancelButtonText: I18N.CANCEL,
            confirmButtonText: I18N.OK,
            closeOnConfirm: false, //warning: 此项配置为false可能会导致选择“是”弹出框关不掉的情况，必须在“是”的callback里调用swal再弹一个。 -by ldzhu
            closeOnCancel: true
        }, callback);
    },
    choose: function (msg,confirmButtonText,cancelButtonText,confirmCallback,cancelCallback) {
        swal({
            title:'',
            text: msg,
            type: 'success',
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: confirmButtonText,
            cancelButtonText: cancelButtonText,
            closeOnConfirm: true,
            closeOnCancel: true
        }, function (isConfirm) {
            if (isConfirm) {
                confirmCallback();
            } else {
                cancelCallback();
            }
        });
    }
};